import defaultSettings from '@/settings'
import i18n from '@/lang'
const Glod = require('../../public/config')

const title = Glod.pageTitle || '终端态势感知管理系统'

export default function getPageTitle(key) {
  const hasKey = i18n.te(`route.${key}`)
  if (hasKey) {
    const pageName = i18n.t(`route.${key}`)
    return `${pageName} - ${title}`
  }
  return `${title}`
}

/** 设置页面标题和ico */
export function setPageTitle(title) {
  const titleObj = getPageTitle(title)
  document.title = titleObj
}
